package IO;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @author wuhan
 * @date 2019/10/10 11:19
 */
public class CopyPic {
    public static void main(String[] args) throws IOException {
        FileInputStream fileInputStream=new FileInputStream("test.JPG");
        FileOutputStream fileOutputStream=new FileOutputStream("out.jpg");
        byte[] buf=new byte[1024*1024];
        int len=0;
        while ((len=fileInputStream.read(buf))!=-1){
            fileOutputStream.write(buf,0,len);
        }
        fileInputStream.close();
        fileOutputStream.close();
    }
}
